<?php

namespace App\Http\Controllers\My\Zd;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use DB;

class GrowController extends Controller
{
    
    public function run(){
        $today = date('Y/m/d');
        $task = DB::table('tasks')->where('enddate','>=',$today)->get();

        foreach($task as $v){
            $v = (array)$v;
            unset($v['tid']);
            unset($v['enddate']);
            $v['paytime'] = $today;

            DB::table('grows')->insert($v);
        }
    }

}
